<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title></title>
    <link rel="stylesheet" type="text/css" href="/tp/Public/css/bootstrap.min.css"/>
    <link rel="stylesheet" type="text/css" href="/tp/Public/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="/tp/Public/css/style.css"/>
</head>

<body>
<div id="container">
    <!---->

    <include file="Public/tpl/header.html"/>

    <!---->

    <div id="main" class="container">
        <div class="row">
            <div class="col-md-8">

                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title"><b>个人中心</b></h3>
                    </div>
                    <div class="panel-body">
                        <div class="col-md-2" style="padding: 0;">
                            <a class="media-left">
                                <img src="__PUBLIC__/images/{$user_info[0]['avatar_name']}" style="height: 100px;width: 100px;margin: 0 auto;"
                                     alt="作者">
                            </a>
                            <br/>
                            <if condition="$Think.session.uid neq $user_info['0']['username']">
                                <a href="#">

                                    <button class="btn btn-primary" data-toggle="modal" data-target="#modal-article">私信</button>
                                    <!---->
                                    <div class="modal fade" id="modal-article" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                                        <div class="modal-dialog">
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                                                    <h4 class="modal-title" id="myModalLabel">
                                                        新建消息
                                                    </h4>
                                                </div>
                                                <form action="{:U('Message/add')}" method="post">

                                                    <div class="modal-body">
                                                        <div class="panel-body">
                                                            <textarea class="form-control" name="content" rows="5" cols="" ></textarea>
                                                        </div>
                                                    </div>
                                                    <div class="modal-footer">
                                                        <input type="hidden" name="from_name" value="{$Think.session.uid}"/>
                                                        <input type="hidden" name="to_id" value="{$user_info[0]['id']}"/>
                                                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                                        <button type="submit" class="btn btn-primary">发送</button>
                                                    </div>
                                                </form>
                                            </div>
                                            <!-- /.modal-content -->
                                        </div>
                                        <!-- /.modal -->
                                    </div>
                                    <!---->





                                </a>
                            </if>
                        </div>

                        <div class="col-md-6">

                            <div class="media-body">
                                <ul class="media list-group">
                                    <h3 class="media-heading topic-list-heading">
                                        <span><i class="icon-user"></i></span>
                                        <span><a href="{:U('user/info',array('id'=>$user_info[0]['id']))}">{$user_info['0']['username']}</a></span>
                                    </h3>

                                    <p class="text-muted">
                                        <span><i class="icon-time"></i></span>
                                        <span>注册</span>
                                        <span>{$user_info['0']['register_time']}</span>
                                    </p>

                                    <p class="text-muted">
                                        <span><i class="icon-pencil"></i></span>
                                        <span>签名</span>
                                        <span>{$user_info['0']['signature']}</span>
                                    </p>

                                    <p class="text-muted">
                                        <span><i class="icon-info-sign"></i></span>
                                        <span>介绍</span>
                                        <span>{$user_info['0']['introduction']}</span>
                                    </p>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title"><b>最近创建的主题</b></h3>
                    </div>
                    <div class="panel-body">
                        <ul class="media list-group">
                            <foreach name="articles" item="article" key="key">
                                <li class="list-group-item">
                                    <a class="media-left" href="{:U('User/info',array('id'=>$article['author_id']))}">
                                        <img src="__PUBLIC__/images/{$article['avatar_name']}" alt="作者"
                                             style="width:50px;height: 50px ;">
                                    </a>

                                    <div class="media-body">
                                        <h3 class="media-heading topic-list-heading">
                                            <span><i class="icon-screenshot icon"></i></span>
                                            <span><a href="{:U('Article/detail',array('id'=>$article['id']))}">{$article['title']}</a></span>
                                        </h3>

                                        <p class="text-muted">
                                            <span><i class="icon-pushpin"></i></span>
                                            <span><a href="{:U('Sort/detail',array('id'=>$article['sort_id']))}">{$article['sort']}</a></span>
                                            <span>|</span>
                                            <span><a href="{:U('User/info',array('id'=>$article['author_id']))}">{$article['author']}</a></span>
                                            <span>|</span>
                                            <span>{$article['create_time']}</span>
                                            <span>|</span>
                                            <span>
                                                <if condition="($article['last_comment'] neq null)">
                                                    最后回复:{$article['last_comment']}
                                                    By <a
                                                        href="{:U('User/info',array('id'=>$article['last_comment_user_id']))}">{$article['last_comment_user_name']}</a>
                                                    <else/>
                                                    暂无回复
                                                </if>

                                            </span>
                                            <span></span>
                                        </p>
                                    </div>
                                </li>

                            </foreach>
                        </ul>
                    </div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title"><b>最近回复</b></h3>
                    </div>
                    <div class="panel-body">
                        <ul class="media list-group">
                            <foreach name="recent_comments" item="recent_comment" key="key">
                                <li class="list-group-item">
                                    <a class="media-left" href="{:U('User/info',array('id'=>$recent_comment['from_id']))}">
                                        <img src="__PUBLIC__/images/{$recent_comments[0]['avatar_name']}" alt="作者">
                                    </a>

                                    <div class="media-body">
                                        <h3 class="media-heading topic-list-heading">
                                            <span><i class="icon-envelope-alt icon"></i></span>
                                            <span>在帖子<a
                                                    href="{:U('Article/detail',array('id'=>$recent_comment['article_id']))}">{$recent_comment['title']}</a>中</span>
                                        </h3>

                                        <p class="text-muted">
                                            <span><i class="icon-time icon"></i></span>
                                            <span>{$recent_comment['create_time']}</span>
                                            <span>对<a href="{:U('User/info',array('id'=>$recent_comment['to_id']))}">{$recent_comment['to_name']}</a>评论</span>
                                            <span>{$recent_comment['content']}</span>
                                        </p>
                                    </div>
                                </li>
                            </foreach>

                        </ul>
                    </div>
                </div>

            </div>

            <div class="col-md-4 hidden-xs">


                <!---->

            </div>
        </div>

    </div>

    <!---->
</div>
<!---->
<footer id="footer">
    <div class="container">
        <p>Powered by BBS 2016-2017 Allright rights reserved</p>
    </div>
</footer>
<!---->
<script src="/tp/Public/js/jquery-1.11.0.js" type="text/javascript" charset="utf-8"></script>
<script src="/tp/Public/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
</body>

</html>